package Collection;

import java.util.ArrayList;
import java.util.Collection;

public class Demo01 {
    public static void main(String[] args) {
        Collection<String> collection=new ArrayList<>();
        collection.add("aaa");
        collection.add("bbb");
        collection.add("ccc");
        //method2(collection);
        //mothed1(collection);
        //method3(collection);
        //method4(collection);
        //method5(collection);

    }

    private static void method5(Collection<String> collection) {
        boolean empty = collection.isEmpty();
        System.out.println(empty);
    }

    private static void method4(Collection<String> collection) {
        int size = collection.size();
        System.out.println(size);
    }

    private static void method3(Collection<String> collection) {
        boolean result = collection.contains("aaa");
        System.out.println(result);
    }

    private static void method2(Collection<String> collection) {
        boolean remove = collection.remove("aaa");
        System.out.println(remove);
        System.out.println(collection);
        collection.removeIf((String s )->{
            return s.length()==3;
        });
    }

    private static void mothed1(Collection<String> collection) {
        collection.clear();
        System.out.println(collection);
    }
}
